<?php 
function cutstr($str, $i, $stopper) {
   $str = htmlspecialchars($str);
   if (strlen($str) > $i){
      $str = substr($str, 0, $i);
      $str .= $stopper;
   }
   return $str;
}
?>
<?php foreach($cartpoolData["shoppingList"] as $list){ ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
	<head> 
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
		
		<title>print list</title>
		<link rel="stylesheet" type="text/css" href="/assets/css/reset.css" />
		<link rel="stylesheet" type="text/css" href="/assets/css/fluid960.css" />
		<link rel="stylesheet" type="text/css" href="/assets/css/print.css" />
		<link rel="icon" type="image/png" href="/assets/images/favicon.ico" />
	</head>
	<body onload="print(); close();">
		<div class="content container_12">
			<div class="grid_12 header">
				<h1 class="grid_7 alpha">Cartpool</h1>
				<h2 class="grid_5 omega" title="date the list was created">list of <?php echo $list->created; ?></h2>
			</div>
				<!-- 
				<span id="shoppingListId" class="hidden"><?php echo $list->id ?></span>
				<span id="shoppingListOffset" class="hidden"><?php echo $list->offset ?></span>
				<span id="shoppingListClosed" class="hidden"><?php echo $list->closed ?></span>
				-->

				<?php
				$i = 0;
				if($list->products){
					foreach($list->products as $product){
						$id = $product->id;
						if($i++&1) { $evenOdd = "even"; } else { $evenOdd = "odd"; } ?>
					
							<div class="grid_12 row <?php echo $evenOdd; ?>">
								<div class="grid_1 alpha qty">
									<input style="float:left;" type="checkbox" />
									<div style="clear:right; text-align: right; padding-top: 3px;"><?php echo $product->qty; ?></div>
								</div>
								<div class="grid_7 product"><?php echo $product->product; ?></div>
								<div class="grid_4 omega person"><?php echo $product->customer; ?></div>
								
								<?php if(!($product->comments == "" || $product->comments == " ")){ ?>
								<div class="alpha omega grid_12 comment">
									<?php echo $product->comments; ?>
								</div>
								<?php } ?>
							</div>
							
						
					<?php } ?>
				<?php } ?>

		<?php } ?>

	</body>
</html>